import 'package:boss/textStyle/text_style.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

class MessageRow extends StatelessWidget {
  final List<Widget> children;
  final Widget suffix;

  const MessageRow({
    Key key,
    this.children,
    this.suffix,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return DefaultTextStyle(
      style: TextStyleConstant().normal_2_26,
      child: Container(
        padding: EdgeInsets.symmetric(
          horizontal: 20.w,
          vertical: 18.w,
        ),
        child: Row(
          children: <Widget>[
            Expanded(
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: children
                    .map((item) => Container(
                          child: item,
                          alignment: Alignment.centerLeft,
                          padding: EdgeInsets.symmetric(
                            vertical: 10.w,
                          ),
                        ))
                    .toList(),
              ),
            ),
            suffix ?? SizedBox(),
          ],
        ),
      ),
    );
  }
}
